import request from '@/utils/request'

export const renYuanList = (params) =>
  request.get('/api/user-service/user/search', { params })
// 新增
export const renYuanAdd = (data) => request.post('/api/user-service/user', data)
// 获取地址
export const site = () => request('/api/vm-service/region/search')
// 删除人员
export const del = (id) => request.delete('/api/user-service/user/' + id)
// 修改
export const compile = (id, data) =>
  request.put('/api/user-service/user/' + id, data)
// 工作量列表
export const workList = (params) =>
  request.get('/api/user-service/user/searchUserWork', { params })

// ==================================

export const getHeader = (start, end) =>
  request({
    method: 'GET',
    url: `/api/task-service/task/taskReportInfo/${start}/${end}`
  })

export const getDownHeader = (start, end) =>
  request({
    method: 'GET',
    url: `/api/task-service/task/collectReport/${start}/${end}`
  })

export const getArea = () =>
  request({
    method: 'GET',
    url: '/api/vm-service/region/search'
  })

export const getRanking = (start, end, isRepair, regionId) =>
  request({
    method: 'GET',
    url: `/api/task-service/task/userWorkTop10/${start}/${end}/${isRepair}/${regionId}`
  })
// ============================
export const getPeopleDetails = (id) =>
  request({
    method: 'GET',
    url: `/api/user-service/user/${id}`
  })
export const getWorkDetails = (params) =>
  request({
    method: 'GET',
    url: '/api/task-service/task/userWork',
    params
  })
export const jiedaoList = (params) =>
  request({
    url: '/api/vm-service/region/search',
    params
  })

export const getroleAPI = (data) =>
  request({
    url: '/api/user-service/role',
    data
  })
export const getWork = (params) =>
  request({
    method: 'GET',
    url: '/api/user-service/user/searchUserWork',
    params
  })
